package com.caltco.cargo.ops.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.caltco.cargo.ops.common.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.sql.Date;
import java.time.LocalDateTime;

@Data
@TableName("frequency_statistics")
@Schema(description = "学习单词")
public class FrequencyStatistics extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "id")
    private Long id;

    @Schema(description = "用户id")
    @TableField("user_id")
    @JsonProperty("userId")
    private Long userId;

    @Schema(description = "单词id")
    @TableField("word_id")
    @JsonProperty("wordId")
    private Long wordId;

    @Schema(description = "单词类型")
    @TableField("word_type")
    @JsonProperty("wordType")
    private String wordType;

    @Schema(description = "错误频率")
    @TableField("incorrect_count")
    @JsonProperty("incorrectCount")
    private Integer incorrectCount;

    @Schema(description = "正确频率")
    @TableField("correct_count")
    @JsonProperty("correctCount")
    private Integer correctCount ;

    @Schema(description = "下次复习时间")
    @TableField("next_review_date")
    @JsonProperty("nextReviewDate")
    private LocalDateTime nextReviewDate ;

    @Schema(description = "上次复习时间")
    @TableField("review_date")
    @JsonProperty("reviewDate")
    private LocalDateTime reviewDate ;

    @Schema(description = "是否复习")
    @TableField("is_review")
    @JsonProperty("isReview")
    private Integer isReview ;

    @Schema(description = "是否删除")
    @TableField("is_delete")
    @JsonProperty("isDelete")
    @TableLogic(value = "0", delval = "1")
    private Integer isDelete;
}
